home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 3006 / 3006.xpi / chrome / dwhelper.jar / content / conv-rule-list.xml < prev    next >
Extensible Markup Language  |  2010-01-15  |  3KB  |  140 lines

  1. <?xml version="1.0"?>
  2. <!-- *****************************************************************************
  3.  *            Copyright (c) 2006-2009 Michel Gutierrez. All Rights Reserved.
  4.  ****************************************************************************** -->
  5. <!DOCTYPE bindings SYSTEM "chrome://dwhelper/locale/dwhelper.dtd" >
  6.  
  7. <bindings xmlns="http://www.mozilla.org/xbl"
  8.     xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  9.     xmlns:html="http://www.w3.org/1999/xhtml"
  10.     xmlns:xbl="http://www.mozilla.org/xbl">
  11.  
  12.     <binding id="ConvRuleList" extends="widgets.xml#widget">
  13.  
  14.         <xbl:content xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  15.             <tree 
  16.                 anonid="xTree"
  17.                 id="dwhelper-conv-rule-list"
  18.                 flex="1"
  19.                 enableColumnDrag="false" 
  20.                 hidecolumnpicker="true"
  21.                 flags="dont-build-content" 
  22.                 datasources="rdf:null" 
  23.                 ref="urn:root"
  24.                 style="height: 100%"
  25.                 seltype="single"
  26.                 >
  27.                 
  28.                 <treecols>
  29.  
  30.                     <treecol 
  31.                         id="dwhelper-conv-rule-list-col0"
  32.                         anonid="xCol0"
  33.                         primary="true"
  34.                         flex="1"
  35.                         Xlabel="&column.conversion.rules;"
  36.                         hideheader="true"
  37.                         />
  38.                         
  39.                 </treecols>
  40.  
  41.                 <template>
  42.                     <rule>
  43.                         <conditions>
  44.                             <content uri="?root"/>
  45.                             <member container="?root" child="?rule"/>
  46.                             <triple subject="?rule"
  47.                                  predicate="http://downloadhelper.net/1.0#label"
  48.                                  object="?label"/>
  49.                         </conditions>
  50.                           <action>
  51.                             <treechildren>
  52.                                 <treeitem
  53.                                     uri="?rule" open="true"
  54.                                     >
  55.                                     <treerow tooltiptext="?label">
  56.                                         <treecell                
  57.                                             label="?label"
  58.                                             value="0"
  59.                                             />
  60.                                     </treerow>
  61.                                 </treeitem>
  62.                             </treechildren>
  63.                         </action>
  64.                     </rule>
  65.                 </template>
  66.  
  67.             </tree>
  68.             <children style="display: none;"/>
  69.         </xbl:content>
  70.  
  71.         <implementation>
  72.  
  73.             <constructor>
  74.                 <![CDATA[
  75. this.datasource=this.convertMgr.getDataSourceCopy();
  76. this.util.setDatasource(this.xTree,this.datasource);
  77.                 ]]>
  78.             </constructor>
  79.  
  80.             <method name="getSelectedRule">
  81.                 <body>
  82.                 <![CDATA[
  83. var selectCount = this.xTree.view.selection.count;
  84. if(selectCount>0) {
  85.     var res=this.xTree.builderView.getResourceAtIndex(this.xTree.currentIndex);
  86.     if(res!=null) {
  87.         return res.Value;
  88.     }
  89. }
  90. return null;
  91.                 ]]>
  92.                 </body>
  93.             </method>
  94.             
  95.             <method name="select">
  96.                 <parameter name="rule"/>
  97.                 <body>
  98.                 <![CDATA[
  99. var RDF=this.util.getRDF();
  100. var index=-1;
  101. if(rule) {
  102.     var ruleRes=RDF.GetResource(rule);
  103.     index=this.xTree.builderView.getIndexOfResource(ruleRes);
  104. }
  105. this.xTree.view.selection.select(index);
  106.                 ]]>
  107.                 </body>
  108.             </method>
  109.  
  110.              
  111.             <method name="getDataSource">
  112.                 <body>
  113.                 <![CDATA[
  114. return this.datasource;
  115.                 ]]>
  116.                 </body>
  117.             </method>
  118.  
  119.         </implementation>
  120.         
  121.         <handlers>
  122.  
  123.             <handler event="dblclick">
  124.                 <![CDATA[
  125. this.fireEvent("RuleDblClicked");
  126.                 ]]>
  127.             </handler>
  128.  
  129.             <handler event="select">
  130.                 <![CDATA[
  131. this.fireEvent("RuleSelect");
  132.                 ]]>
  133.             </handler>
  134.  
  135.         </handlers>
  136.                 
  137.     </binding>
  138.  
  139. </bindings>
  140.